"""
author：wang tian cheng
date: 2020/11/10
project: ldj
"""


#
# import re
# while True:
#     number=input("请输入字符，按exit退出")
#     if number=="exit":
#         break
#     elif number in re.findall(r"^\+?[1-9]\d*",number):
#         print("这是正整数")
#     elif number in re.findall(r"^\-[1-9]\d*",number):
#         print("这是负整数")
#     elif number in re.findall(r"^\+?[1-9]\d*\.\d*|^\-[1-9]\d*\.\d*",number):
#         print("这是浮点数")
#     else:
#         print("请输入正确的值")


# import re
# while True:
#     print("密码要求8-10位，以（字母或者下划线开头）")
#     number1=input("请输入想验证的密码: ")
#     if number1=="exit":
#         break
#     elif number1 in re.findall("^[A-Za-z\_].{7,9}",number1):
#         print("合法")
#     else:
#         print("不合法")

###################################
#######################################
# import re
# user = input("请输入你的名字: ")
# number2=input("请输入11位的电话号码: ")
# print("1.wen tel: 12345678900")
# print("2.wen tel: 123-4567-8900")
# print("3.wen tel: 123 4567 8900")
# print("4.wen tel: (+86)12345678900")
format1=input("请提取出你输入的格式: ")
import re
ret = re.search("(\(\+86\))?1\d{2}([ \-]?\d{4}){2}",format1)
ret = re.search(r"1\d{2}([ \-]?)\d{4}\1\d{4}",format1)
print("打印:",ret)
# if format1=="1":
#     ret=re.findall("^[1-9]\d{10,11}",number2)
#     print(ret)
#     for i in ret:
#         print(f"{user} tel: {i[0:]}")
# if format1=="2":
#     ret=re.findall("^[1-9]\d{2,3}\-\d{4,5}\-\d{4,5}",number2)
#     print(number2)
#     for j in ret:
#         print(f"{user} tel: {j[0:]}")
# if  format1=="3":
#     ret=re.findall("^[1-9]\d{2,3}\ \d{4,5}\ \d{4,5}",number2)
#     print(number2)
#     for k in ret:
#         print(f"{user} tel: {k[0:]}")
# if  format1=="4":
#     ret=re.findall("^\(\+86\)[1-9]\d{10,11}",number2)
#     print(number2)
#     for k in ret:
#         print(f"{user} tel: {k[0:]}")



#######九九乘法表
# for i in range(9):
#     for j in range(i+1):
#         print(f"{j+1}*{i+1}={(j+1)*(i+1)}",end=" ")
#     print()


#######1-100d的和
# j=0
# for i in range(101):
#     j+=i
# print(j)

#######如何跨平台共享变量
# https://www.cnblogs.com/sayiqiu/p/10966064.html

#######python中生成随机整数（1-10）
# import random
# num1=random.randint(0,10)
# print(num1)

######python中哪些是可变数据类型，哪些是不可变数据类型，为什么
# 列表、集合、字典都是属于可变数据类型
# 元祖、字符串、整型、浮点型、布尔型都是不可变数据类型

######统计字符串中每个字符出现的次数
# a="1234455667asd"
# b=set(a)
# for i in b:
#     print(i,a.count(i))

####python实现，给定一个字符串，找到字符串中第一个重复的字符
# a="1234455667asdd"
# for i,j in enumerate(a):
#     if a[i]==a[i-1]:
#         print(j)
#         break

#####重复接受一个用户输入的字符，如果是正整数，就输出结果，否则就一直输入
# import re
# while True:
#     number=input("请输入正整数: ")
#     if number in re.findall(r"^\+?[1-9]\d*",number):
#         print(number)
#         break

#########用python实现冒泡排序

# def bubble_sort(array):
#     for i in range(1, len(array)):
#         for j in range(0, len(array) - i):
#             if array[j] > array[j + 1]:
#                 array[j], array[j + 1] = array[j + 1], array[j]
#     return array
# array = [10, 17, 50, 7, 30, 24, 27, 45, 15, 5, 36, 21]
# print(bubble_sort(array))
